package com.example.administrator.printoutindemo;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import java.util.List;

public class MyAutoAarryAdapter extends ArrayAdapter{



	private int resourceId;
	private Context mContext = null;
	private LayoutInflater mInflater = null;
	
	private class ViewHolder {
		TextView txt_title;
	}
	
	private ViewHolder holder = null;
	
	public MyAutoAarryAdapter(Context context, int resource, List objects) {
		super(context, resource, objects);
		resourceId = resource;
		mContext = context;
		this.mInflater = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	}
	
	
	

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {

		if (convertView == null) {
			holder = new ViewHolder();
			convertView = mInflater.inflate(R.layout.store_adapter_mylist_item,
					null);
			
			holder.txt_title = (TextView) convertView
					.findViewById(R.id.adapter_mylist);

			convertView.setTag(holder);
		}else {
			holder = (ViewHolder) convertView.getTag();
		}
		
		String str = getItem(position).toString();
		
		holder.txt_title.setText(str);
		
		return convertView;
	}

}
